package net.openl10n.api.document;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;

import net.openl10n.api.Namespaces;

@XmlRootElement(name="document-content", namespace=Namespaces.DOCUMENT)
public class Content {

	private List<Resource> resources;

	@XmlElements({
		@XmlElement(name="text-flow", type=TextFlow.class, namespace=Namespaces.DOCUMENT),
		@XmlElement(name="container", type=Container.class, namespace=Namespaces.DOCUMENT),
		@XmlElement(name="reference", type=Reference.class, namespace=Namespaces.DOCUMENT),
		@XmlElement(name="data-hook", type=DataHook.class, namespace=Namespaces.DOCUMENT)
		})
	public List<Resource> getResources() {
		if(resources == null)
			resources = new ArrayList<Resource>();
		return resources;
	}
	
}
